import request from "../request";

// 获取用户列表
const getUserVideo = (query: any) => {
  return request({
    url: "/website/video/list",
    method: "get",
    params: query,
  });
};

// 获取用户观看历史
const getWatchHistory = (query: any) => {
  return request({
    url: "/client/history/list",
    method: "get",
    params: query,
  });
};

// 新增收藏夹
const addCollect = (query: any) => {
  return request({
    url: "/website/collect-folder",
    method: "post",
    data: query,
  });
};

// 获取收藏夹列表
const getCollectList = (query: any) => {
  return request({
    url: "/website/collect-folder/selectCollectFolder",
    method: "get",
    params: query,
  });
};

// 获取收藏夹下的收藏视频
const getCollections = (query: any) => {
  return request({
    url: "/website/collect/selectCollect",
    method: "get",
    params: query,
  });
};

// 删除收藏夹
const deleteCollect = (id: string) => {
  return request({
    url: `/website/collect-folder/${id}`,
    method: "delete",
  });
};

export {
  getUserVideo,
  getWatchHistory,
  addCollect,
  getCollectList,
  getCollections,
  deleteCollect
};
